package com.xiaomi.eco.scheduler;

import com.xiaomi.cloud.plan.client.plan.PlanExecutor;
import com.xiaomi.cloud.plan.client.spring.annotation.PlanTask;
import com.xiaomi.eco.dal.entity.EcoCompanyTaskListEntity;
import com.xiaomi.eco.dal.entity.EcoCompanyWebMappingEntity;
import com.xiaomi.eco.dal.res.CompanyAvailabilityRes;
import com.xiaomi.eco.mapper.EcoCompanyTaskListEntityMapper;
import com.xiaomi.eco.mapper.EcoMethodDimensionEntityMapper;
import com.xiaomi.eco.service.EcoCompanyTaskListEntityService;
import com.xiaomi.eco.service.EcoCompanyWebMappingEntityService;
import com.xiaomi.eco.service.impl.EcoWeeklyMonitoringServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.client.RestTemplate;

import java.text.DecimalFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Slf4j
@PlanTask(name = "EcoWeeklyMonitor", quartzCron = "0 0 9 ? * MON", description = "每周一上午9点发送群监控数据")
public class EcoWeeklyMonitoringTask implements PlanExecutor {

   @Autowired
   private EcoWeeklyMonitoringServiceImpl ecoWeeklyMonitoringService;

    @Override
    public void execute() {
        ecoWeeklyMonitoringService.sendWeeklyMonitoringData();
    }
}
